package dataStructure.xmg1.a11;

import dataStructure.xmg1.a11.set.ListSet;
import dataStructure.xmg1.a11.set.Set;
import dataStructure.xmg1.a11.set.Set.Visitor;
import dataStructure.xmg1.a11.set.TreeSet;

/**
 * @author: vince_zww
 * @date: 2021/2/21 23:23
 * @desceription:
 */
public class Main {

    public static void main(String[] args) {
//        Set<Integer> listSet = new ListSet<>();
//        listSet.add(10);
//        listSet.add(11);
//        listSet.add(11);
//        listSet.add(12);

        Set<Integer> treeSet = new TreeSet<>();
        treeSet.add(10);
        treeSet.add(7);
        treeSet.add(11);
        treeSet.add(8);
        treeSet.add(11);
        treeSet.add(11);
        treeSet.add(12);

        treeSet.traversal(new Visitor<Integer>() {
            @Override
            public boolean visit(Integer element) {
                System.out.println(element);
                return false;
            }
        });

    }
}
